package club.justwill.single.model;

/**
 * Created by xiangnan on 16-1-3.
 */
public class UserAliaseType {
    public static int USERNAME = 0;
    public static int PHONENUMBER = 10;
    public static int WEIXIN = 20;
    public static int WEIBO = 30;
    public static int ALIPAY = 40;

    public static String getUserType(int type) {
        switch(type) {
            case 0 : return "USERNAME";
            case 10 : return "PHONENUMBER";
            case 20 : return "WEIXIN";
            case 30 : return "WEIBO";
            case 40 : return "ALIPAY";
            default: return null;
        }
    }

    public static int getUserTypeCode(String type) {
        if(type.equals("USERNAME")) { return 0;}
        if(type.equals("PHONENUMBER")) { return 10;}
        if(type.equals("WEIXIN")) { return 20;}
        if(type.equals("WEIBO")) { return 30;}
        if(type.equals("ALIPAY")) {return 40;}
        return 0;
    }
}
